<?php
$row_url = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
$path_parts = pathinfo($row_url);
if (!isset($path_parts['filename']) || !$path_parts['filename']) exit('出错的了');
if (isset($_POST['pid'])) {
	$post = http_build_query($_POST, null, '&amp;');
	$post = htmlspecialchars_decode($post);
	$_SERVER['QUERY_STRING'] = $post;
}
$href_url = 'http://'.$_SERVER['HTTP_HOST'].'/api/Pay/api'.(empty($_SERVER['QUERY_STRING'])?'':'?'.$_SERVER['QUERY_STRING']);
$href_content = "<script>window.location.href='".$href_url."';</script>";
echo $href_content;